package com.nuanshui.heatedloan.fund.biz.service;

import com.nuanshui.framework.consts.TransactionManagerType;
import com.nuanshui.heatedloan.constant.ServiceConstant;
import com.nuanshui.heatedloan.fund.biz.dal.mapper.TonlyTradeInfoMapper;
import com.nuanshui.heatedloan.fund.facade.TonlyTradeInfoService;
import com.nuanshui.heatedloan.fund.model.TonlyTradeInfo;
import com.nuanshui.heatedloan.fund.vo.TonlyTradeInfoVO;
import com.nuanshui.heatedloan.pageable.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author zss
 * @date 2017/7/25 12:11
 * @description
 * @Since
 */
@Service(ServiceConstant.TONLYTRADEINFOSERVICE)
@Transactional(readOnly = true,value= TransactionManagerType.FUND_TRANSACTION_MANAGER)
public class TonlyTradeInfoServiceImpl implements TonlyTradeInfoService {

    @Autowired
    private TonlyTradeInfoMapper tonlyTradeInfoMapper;

    @Override
    @Transactional(readOnly = false,value=TransactionManagerType.FUND_TRANSACTION_MANAGER)
    public void insert(TonlyTradeInfo tradeInfo) {
        tonlyTradeInfoMapper.insert(tradeInfo);
    }

    @Override
    @Transactional(readOnly = false,value=TransactionManagerType.FUND_TRANSACTION_MANAGER)
    public void update(TonlyTradeInfo tradeInfo) {
        tonlyTradeInfoMapper.update(tradeInfo);
    }

    @Override
    public List<TonlyTradeInfoVO> load(Pager<TonlyTradeInfo> pager, String userId) {
        return tonlyTradeInfoMapper.load(pager,userId);
    }

    @Override
    public TonlyTradeInfoVO loadByReqSn(String reqSn) {
        return tonlyTradeInfoMapper.loadByReqSn(reqSn);
    }
}
